<?php
/**
 * 基类
 *
 * Created	: 2010-11-05
 * Modified : 2010-11-05
 * @author  : 陈立强
 */
abstract class MCBase
{
	public static $cfg = null;

	/**
	 * 初始化操作，初始一些基础数据
	 */
	public static function init($class_name)
	{
		global $G;
		if (method_exists($class_name, 'initialize')) {
			call_user_func(array($class_name, 'initialize'));
		} elseif (property_exists($class_name, 'cfgName')) {
			eval("$class_name::\$cfg = C($class_name::\$cfgName);");
		} elseif (property_exists($class_name, 'cfg')) {
			if (is_file($file = $G['path_cfg'].strtolower($class_name).'.cfg.php')) {
				;
			} elseif (is_file($file = $G['path_cfg'].$class_name.'/'.strtolower($class_name).'.cfg.php')) {
				;
			} else {
				$file = '';
			}
			if ($file != '') {
				eval("$class_name::\$cfg = include('$file');");
			}
		}
		return true;
	}


	
}